<%@ Register TagPrefix="skm" Namespace="FAQControls" Assembly="FAQControls" %>

<%@ Page Language="c#" Codebehind="UserAdmin.aspx.cs" AutoEventWireup="True" Inherits="Adge.Web.Faq.Admin.UserAdmin" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
    <title>skmFAQs.NET :: User Administration</title>
    <link href="../FAQstyle.css" type="text/css" rel="stylesheet">
</head>
<body ms_positioning="FlowLayout">
    <form id="Form1" method="post" runat="server">
        <p>
            <skm:LoginPanel ID="LoginPanel1" runat="server" CssClass="faq_logout" />
        </p>
        <h1>
            User Administration</h1>
        <div class="faq_breadcrumb">
            <a href="Default.aspx">skmFAQs.NET Administration</a> &gt; User Administration</div>
        <p>
            <asp:ValidationSummary ID="ValidationSummary1" runat="server"></asp:ValidationSummary>
            <asp:LinkButton ID="lnkCreateUser" runat="server" CausesValidation="False" OnClick="lnkCreateUser_Click">Create a New User</asp:LinkButton>
            &nbsp;| <a href="PermissionsAdmin.aspx">Permissions Administration</a></p>
        <asp:DataGrid ID="dgUsers" runat="server" AllowSorting="True" AllowPaging="True"
            AutoGenerateColumns="False" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px"
            BackColor="White" CellPadding="4" DataKeyField="UserID">
            <SelectedItemStyle Font-Bold="True" ForeColor="#663399" BackColor="#FFCC66"></SelectedItemStyle>
            <ItemStyle ForeColor="#330099" BackColor="White"></ItemStyle>
            <HeaderStyle Font-Bold="True" ForeColor="#FFFFCC" BackColor="#990000"></HeaderStyle>
            <FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle>
            <Columns>
                <asp:EditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel"
                    EditText="Edit"></asp:EditCommandColumn>
                <asp:ButtonColumn Text="Delete" CommandName="Delete"></asp:ButtonColumn>
                <asp:TemplateColumn SortExpression="Username" HeaderText="Username">
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Username") %>'>
                        </asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="usernameEdit" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Username") %>'>
                        </asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="You must provide a username."
                            Display="Dynamic" ControlToValidate="usernameEdit">*</asp:RequiredFieldValidator>
                    </EditItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn SortExpression="Password" HeaderText="Password">
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Password") %>'>
                        </asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="passwordEdit" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Password") %>'>
                        </asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="You must provide a password."
                            Display="Dynamic" ControlToValidate="passwordEdit">*</asp:RequiredFieldValidator>
                    </EditItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn SortExpression="PublicEmail" HeaderText="Public Email">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.PublicEmail") %>'>
                        </asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="publicEmailEdit" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.PublicEmail") %>'>
                        </asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="The public email must be a valid email address."
                            Display="Dynamic" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                            ControlToValidate="publicEmailEdit">*</asp:RegularExpressionValidator>
                    </EditItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn SortExpression="PrivateEmail" HeaderText="Private Email">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.PrivateEmail") %>'>
                        </asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="privateEmailEdit" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.PrivateEmail") %>'>
                        </asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="The private email address must be a valid email address."
                            Display="Dynamic" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                            ControlToValidate="privateEmailEdit">*</asp:RegularExpressionValidator>
                    </EditItemTemplate>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="DateCreated" SortExpression="DateCreated" ReadOnly="True"
                    HeaderText="User Since" DataFormatString="{0:d}"></asp:BoundColumn>
                <asp:TemplateColumn SortExpression="Active" HeaderText="Active">
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    <ItemTemplate>
                        <asp:CheckBox ID="CheckBox2" runat="server" Enabled="False" Checked='<%# DataBinder.Eval(Container, "DataItem.Active") %>'>
                        </asp:CheckBox>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:CheckBox ID="activeEdit" runat="server" Checked='<%# DataBinder.Eval(Container, "DataItem.Active") %>'>
                        </asp:CheckBox>
                    </EditItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn SortExpression="IsAdmin" HeaderText="Admin">
                    <ItemTemplate>
                        <asp:CheckBox ID="CheckBox1" runat="server" Enabled="False" Checked='<%# DataBinder.Eval(Container, "DataItem.IsAdmin") %>'>
                        </asp:CheckBox>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:CheckBox ID="isAdminEdit" runat="server" Checked='<%# DataBinder.Eval(Container, "DataItem.IsAdmin") %>'>
                        </asp:CheckBox>
                    </EditItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <PagerStyle HorizontalAlign="Right" ForeColor="#330099" BackColor="#FFFFCC" Mode="NumericPages">
            </PagerStyle>
        </asp:DataGrid>
        <asp:Panel ID="pnlCreateUserUI" runat="server" Visible="False">
            <table border="0">
                <tr>
                    <td align="right">
                        <b>Username:</b></td>
                    <td align="left">
                        <asp:TextBox ID="usernameAdd" runat="server" MaxLength="50"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="You must provide a username."
                            Display="Dynamic" ControlToValidate="usernameAdd">*</asp:RequiredFieldValidator></td>
                </tr>
                <tr>
                    <td align="right">
                        <strong>Password:</strong></td>
                    <td align="left">
                        <asp:TextBox ID="passwordAdd" runat="server" MaxLength="50"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="You must provide a password."
                            Display="Dynamic" ControlToValidate="passwordAdd">*</asp:RequiredFieldValidator></td>
                </tr>
                <tr>
                    <td align="right">
                        <strong>Public Email:</strong></td>
                    <td align="left">
                        <asp:TextBox ID="publicEmailAdd" runat="server" MaxLength="100" Columns="40"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ErrorMessage="The public email must be a valid email address."
                            Display="Dynamic" ControlToValidate="publicEmailAdd" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator></td>
                </tr>
                <tr>
                    <td align="right">
                        <strong>Private Email:</strong></td>
                    <td align="left">
                        <asp:TextBox ID="privateEmailAdd" runat="server" MaxLength="100" Columns="40"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ErrorMessage="The private email must be a valid email address."
                            Display="Dynamic" ControlToValidate="privateEmailAdd" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator></td>
                </tr>
                <tr>
                    <td align="right">
                        <strong>Is Administrator?</strong></td>
                    <td align="left">
                        <asp:CheckBox ID="isAdministrator" runat="server"></asp:CheckBox></td>
                </tr>
                <tr>
                    <td align="right">
                        <strong>Is Active?</strong></td>
                    <td align="left">
                        <asp:CheckBox ID="isActive" runat="server" Checked="True"></asp:CheckBox></td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <asp:Button ID="btnAdd" runat="server" Text="Create User" OnClick="btnAdd_Click"></asp:Button>&nbsp;&nbsp;
                        <asp:Button ID="btnCancelCreate" runat="server" CausesValidation="False" Text="Cancel"
                            OnClick="btnCancelCreate_Click"></asp:Button></td>
                </tr>
            </table>
        </asp:Panel>
        <p>
            &nbsp;</p>
    </form>
</body>
</html>
